package com.liuhx.mapper;

import com.liuhx.entity.CityEntity;
import com.liuhx.mapper.sql.CitySql;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * Created by liuhx on 2017/6/21.
 */
public interface CityMapper {

    @InsertProvider(type = CitySql.class,method = "insertCitys")
    @Options(useGeneratedKeys = true, keyProperty = "cityId")
    void insertCitys(List<CityEntity> cityEntityList);

    @Select("select cityName,cityUrl from city_info")
    @Results(
            {
                    @Result(property = "cityName",column = "cityName"),
                    @Result(property = "cityUrl",column = "cityUrl")
            }
    )
    List<CityEntity> findAllCity();
    @Select("select * from city_info")
    List<CityEntity> findAllCityHaveId();

}
